FINERACT-2489: Fix NPE for missing charts in Recurring Deposit Product#5490
Conversation
dc1e201 to
c160eb2
Compare
|
Rebased the branch onto the latest develop and force-pushed. Thank you! |
|
I checked the failed job and it appears that the failure in I have not modified any build or dependency configuration in this PR but please let me know if you think I should investigate anything further or rebase once this is resolved in |
|
@Dhanno98 could you please resolve the conflicts? |
|
Yeah sure! |
c160eb2 to
a10e253
Compare
|
I have resolved the conflicts and rebased the branch on the latest develop and force-pushed. Thank you. |
|
Now I see the E2E tests are failing. Both failures indicate that the backend now returns one additional loan transaction compared to what the feature files expect. My change is limited to deposit product validation under savings and does not touch the loan logic, so I might be missing some context on the loan side. Could you please guide me on how you would like this handled? I'm happy to investigate further or make adjustments if needed. Thank you for your help. |
Description
Implements FINERACT-2489.
Problem
While creating a Recurring Deposit Product using POST
/v1/recurringdepositproducts, the request fails with HTTP 500 Internal Server Error when thechartsparameter is omitted.Current Behavior
The validation flow effectively requires
chartsas required. However, when it is missing a NullPointerException occurs insideDepositProductDataValidator.validateChartsData()before the validation framework can return a proper validation error.So the users receive a 500 response instead of a 400 along with a meaningful validation message.
Why this happens
Unlike optional parameters, the code path for
chartsdoes not checkparameterExists()before validation, which indicates the parameter is mandatory.DataValidatorBuilder.notNull().jsonArrayNotEmpty()is already present but execution proceeds further and triggers NPE.What this PR does
chartsfrom Optional Fields to Mandatory Fields.Result after fix
If
chartsis missing, the API now returns a consistent validation error, similar to other mandatory fields.No functional behavior is changed beyond improving error handling and documentation alignment.
Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
Your assigned reviewer(s) will follow our guidelines for code reviews.